public class Numbers
{
   /**
      Returns the number of digits in the binary
      representation of a number
      @param n a nonnegative number
      @return the number of binary digits needed to
      represent n
   */
   
   // TODO: supply the method
   public static int binaryDigits(int i){
      int a=0;
      if(i==0)
      {
         a=1;
      }
      else
      {
         while(i!=0)
         {
            i=i/2;
            a++;
         }
      }
      return a;
   }
   
   public static void main(String[] args)
   {
      System.out.println(Numbers.binaryDigits(1000));
   }
}